export function newMap () {
  var map = new BMap.Map('map')// 创建Map实例
  
  map.enableScrollWheelZoom(true)//开启鼠标滚轮缩放

  //设置地图样式,隐藏建筑物等
  map.setMapStyle({
    styleJson: [
      {
        "featureType": "road",
        "elementType": "all",
        "stylers": {
          "lightness": 20
        }
      },
      {
        "featureType": "highway",
        "elementType": "geometry",
        "stylers": {
          "color": "#f49935"
        }
      },
      {
        "featureType": "railway",
        "elementType": "all",
        "stylers": {
          "visibility": "off"
        }
      },
      {
        "featureType": "local",
        "elementType": "labels",
        "stylers": {
          "visibility": "off"
        }
      },
      {
        "featureType": "water",
        "elementType": "all",
        "stylers": {
          "color": "#d1e5ff"
        }
      },
      {
        "featureType": "poi",
        "elementType": "labels",
        "stylers": {
          "visibility": "off"
        }
      }
    ]
  })

  // 添加缩放控件
  // const top_left_navigation = new BMap.NavigationControl()
  // this.map.addControl(top_left_navigation)
  //添加地图类型控件
  // this.map.addControl(new BMap.MapTypeControl({
  //   mapTypes: [
  //     BMAP_NORMAL_MAP,
  //     BMAP_HYBRID_MAP
  //   ]
  // }))

  return map
}